﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Web4Comment.Service
{
    public interface INewsService
    {


        /// <summary>
        /// 推荐新闻
        /// </summary>
        /// <param name="fromId">推荐者id</param>
        /// <param name="toId">被推荐者id</param>
        /// <param name="newsId">新闻id</param>
        /// <returns></returns>
        int recommendNews(int fromId, int toId, int newsId);

        /// <summary>
        /// 获取推荐新闻
        /// </summary>
        /// <param name="userId">被推荐的用户</param>
        /// <returns>所有新闻(考虑分页？已查看)</returns>
        List<UnlessComment.Model.News> getRecommendNews(int userId);

        /// <summary>
        /// 添加一条新闻
        /// </summary>
        /// <param name="url">链接</param>
        /// <param name="content">内容</param>
        /// <returns></returns>
        int addNews(string url, string content);

        /// <summary>
        /// 删除新闻
        /// </summary>
        /// <param name="newsId">新闻id</param>
        /// <returns></returns>
        /// 只有作者有权限
        int deleteNews(int newsId);

        /// <summary>
        /// 查看新闻
        /// </summary>
        /// <param name="newsId">新闻id</param>
        /// <returns></returns>
        UnlessComment.Model.News getSingleNews(string url);

    }
}
